#!/usr/bin/python
# -*- coding: utf-8 -*-

import math

import numpy

def round_significant(x, n):
    """ Return x with n significant digits """
    digits = int(n - math.ceil(math.log10(abs(x))))
    return round(x, digits)

def is_numeric(text):
    if isinstance(text, str):
        ret = True
        
        if text != "":
            try:
                if text[-1] == '.':
                    fl = numpy.float(text[0:-1])
                else:
                    fl = numpy.float(text)
                    
                if round(fl, 2) == 0.00:
                    ret = False
                else:
                    ret = True
            except ValueError:
                ret = False
        else:
            ret = False
            
        return ret
    else:
        raise ValueError("is_numeric accepts only")
    return None
